home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / Python 1.1 / Lib / stdwin / stdwinq.py < prev    next >
Encoding:
Text File  |  1991-08-16  |  1.0 KB  |  31 lines  |  [TEXT/R*ch]

  1. # Replacements for getevent() and pollevent(),
  2. # and new functions ungetevent() and sync().
  3.  
  4.  
  5. # Every library module should ideally use this instead of
  6. # stdwin.{get,poll}event(), so applications can use the services
  7. # of ungetevent() and sync().
  8.  
  9.  
  10. import stdwin
  11.  
  12.  
  13. # Events read ahead are stored in this queue.
  14. #
  15. queue = []
  16.  
  17.  
  18. # Replacement for getevent().
  19. #
  20. def getevent():
  21.     if queue:
  22.         event = queue[0]
  23.         del queue[0]
  24.         return event
  25.     else:
  26.         return stdwin.getevent()
  27.  
  28.  
  29. # Replacement for pollevent().
  30. #
  31. def polle